﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Uipath_License.Model
{
    public class Request_License
    {
        /// <summary>
        /// 名
        /// </summary>
        public string FirstName { get; set; }
        /// <summary>
        /// 姓
        /// </summary>
        public string LastName { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 公司
        /// </summary>
        public string Company { get; set; }
        /// <summary>
        /// 国家ISO
        /// </summary>
        public string CountryISO { get; set; }
        /// <summary>
        /// 行业
        /// </summary>
        public int IndustryId { get; set; }
        /// <summary>
        /// 国家ID
        /// </summary>
        public int CountryId { get; set; }
        /// <summary>
        /// 领域？
        /// </summary>
        public bool IsAgreedTrialAgreement { get; set; }
        /// <summary>
        /// 公司
        /// </summary>
        public bool IsPrivacyPolicyAccepted { get; set; }
        /// <summary>
        /// 产品ID?
        /// </summary>
        public int ProductId { get; set; }
        /// <summary>
        /// 国家名称
        /// </summary>
        public string CountryName { get; set; }
        /// <summary>
        /// 职称
        /// </summary>
        public string JobTitle { get; set; }
        /// <summary>
        /// 产业名称
        /// </summary>
        public string IndustryName { get; set; }
        /// <summary>
        /// 状态名称？
        /// </summary>
        public string StateName { get; set; }
        /// <summary>
        /// ？？？
        /// </summary>
        public string StateId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ProductInterestName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ProductInterestId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int ProductTrialOptionsId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string JobLevelsId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string JobLevelsName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string Lang { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ClientId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string TrackId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public void Request_License_Default() 
        {
            FirstName = GetRandomStr(2, lastName);
            LastName = GetRandomStr(1, lastName);
            Email= $"{GetRandomStr(10)}@{GetRandomStr(5)}.com";
            PhoneNumber = "1"+GetRandomStr(10);
            Company = $"{GetRandomStr(3)} {GetRandomStr(3)} {GetRandomStr(3)} {GetRandomStr(3)} {GetRandomStr(3)}";
            CountryISO = "DZ";
            IndustryId = 47;
            CountryId = 3;
            IsAgreedTrialAgreement = true;
            IsPrivacyPolicyAccepted= true;
            ProductId = 1;
            CountryName = "Algeria";
            JobTitle = "Software Engineer";
            IndustryName = "Education";
            StateName = null;
            StateId = null;
            ProductInterestName = null;
            ProductInterestId = null;
            ProductTrialOptionsId = 2;
            JobLevelsId = null;
            JobLevelsName = null;
            Lang = "en";
            ClientId = "1.1";
            TrackId = "UA-1-2";
        }
        private static Random random = new Random();

        string lastName = "赵钱孙李周吴郑王冯陈诸卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜戚谢邹喻柏水窦章云苏潘葛奚范彭郎鲁韦昌马苗凤花方俞任袁柳酆鲍史唐费廉岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅皮卡齐康伍余元卜顾孟平黄和穆萧尹姚邵堪汪祁毛禹狄米贝明臧计伏成戴谈宋茅庞熊纪舒屈项祝董粱杜阮蓝闵席季麻强贾路娄危江童颜郭梅盛林刁钟徐邱骆高夏蔡田樊胡凌霍虞万支柯昝管卢莫经房裘缪干解应宗丁宣贲邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊於惠甄麴家封芮羿储靳汲邴糜松井段富巫乌焦巴弓牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁仇栾暴甘钭厉戎祖武符刘景詹束龙叶幸司韶郜黎蓟薄印宿白怀蒲台从鄂索咸籍赖卓蔺屠蒙池乔阴鬰胥能苍双闻莘党翟谭贡劳逄姬申扶堵冉宰郦雍郤璩桑桂濮牛寿通边扈燕冀郏浦尚农温别庄晏柴瞿阎充慕连茹习宦艾鱼容向古易慎戈廖庚终暨居衡步都耿满弘匡国文寇广禄阙东殴殳沃利蔚越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相查后荆红游竺权逯盖益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇甫尉迟公羊澹台公冶宗政濮阳淳于单于太叔申屠公孙仲孙轩辕令狐钟离闾丘长孙慕容鲜于宇文司徒司空亓官司寇仉督子车颛孙端木巫马公西漆雕乐正壤驷公良拓跋夹谷宰父谷粱晋楚闫法汝鄢涂钦段干百里东郭南门呼延归海羊舌微生岳帅缑亢况后有琴梁丘左丘东门西门商牟佘佴伯赏南宫墨哈谯笪年爱阳佟第五言福百家姓终";
        /// <summary>
        /// 随机字符串
        /// </summary>
        /// <param name="chars"></param>
        /// <param name="length"></param>
        /// <returns></returns>
        public string GetRandomStr(int length, string chars="")
        {
            if (string.IsNullOrEmpty(chars))
            {
                chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghizklmnopqrstuvwxyz0123456789";
            }
            //const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            return new string(Enumerable.Repeat(chars, length)
              .Select(s => s[random.Next(s.Length)]).ToArray());
        }

        
    }
}
